<template>
  <div>
    <el-tabs type="border-card">
  <el-tab-pane label="单元详情" class="box">
    <p><span style="color:red">*</span> 小区名称： <span>{{this.communityname}}</span></p>
    <p><span style="color:red">*</span> 单元名称： <span>{{this.unitname}}</span></p>
    <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:red">*</span> 栋数：{{this.unitnum}} <span></span></p>
    <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:red">*</span> 状态： <span>{{statusText}}</span></p>
    <p> &nbsp;&nbsp;&nbsp;咨询问候： <span v-html="this.unitcontext"></span></p>
     <div class="anniu">
        <el-button type="primary" icon="el-icon-refresh-left" style="margin-left:10px" @click="back">返回</el-button>
        <el-button type="primary" icon="el-icon-document" style="margin-top:10px;" @click="keep">编辑</el-button>
    </div>
  </el-tab-pane>
  
</el-tabs>
  </div>
</template>

<script>
export default {
    data(){
        return{
            id:"",
            communityname:"",
            unitname:"",
            unitnum:"",
            unitstatus:"",
            unitcontext:""
        }
    },
    methods:{
         getlist(){
            this.communityname = localStorage.getItem("communityname")
            this.unitname = localStorage.getItem("unitname")
            this.unitnum = localStorage.getItem("unitnum")
            this.unitstatus = localStorage.getItem("unitstatus")
            this.unitcontext = localStorage.getItem("unitcontext")
            this.id = localStorage.getItem("id")
            console.log(this.communityname);
            
        },
        back(){
        this.$router.replace("unit")
      },
       keep(){
        localStorage.setItem("communityname",this.communityname)
        localStorage.setItem("unitname",this.unitname)
        localStorage.setItem("unitnum",this.unitnum)
        localStorage.setItem("unitstatus",this.unitstatus)
        localStorage.setItem("unitcontext",this.unitcontext)
        this.$router.replace("bianji")
        
    },
   
   

},
 created(){
        this.getlist();
        
    },
     computed:{
      statusText() {
        return Number(this.unitstatus) === 1? "已建成" : "未建成";
      }
    }
}
</script>

<style scoped>
p{
    margin-top: 20px;
}
.anniu{
    width: 90px;
    position: fixed;
    right: 10px;
    top: 200px;
    
}
.box{
    position: relative;
    
}

</style>